﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Shopping.BLL;
using Shopping.Model;
using Shopping.DAL;
using Shopping.Common;
using Maticsoft.DBUtility;

public partial class Home_Pay_return_url : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        DbHelperSQL.ExecuteSql("Insert into Logs (Url,CreateDate) values('" + Utility.GetWebPageUrl() + "',getdate());");

        if (!IsPostBack)
        {
            var orderid = Request.QueryString["out_trade_no"] as string;
            OrdersManage manage = new OrdersManage();
            var orderinfo = manage.GetOrder(Convert.ToInt32(orderid))
                ;
            orderinfo.Order.OrderStatus = "已付款";
            ReturnValue ret = manage.SaveOrder(orderinfo);
            if (ret.IsSucc)
            {
                Response.Redirect("/home/myorders.aspx");
            }
        }
    }
}